float4x4 gWVP;
texture gTex;
texture gTexAlpha;

sampler texSampler = sampler_state
{
	Texture = <gTex>;	
	MinFilter = LINEAR;
	MipFilter = LINEAR;	
	MagFilter = LINEAR;
};
sampler texAlphaSampler = sampler_state
{
	Texture = <gTexAlpha>;
	MinFilter = LINEAR;
	MipFilter = LINEAR;
	MagFilter = LINEAR;
};

struct Output
{
	float4 posH		: POSITION0;
	float2 tex		: TEXCOORD0;
};

Output GrassVS(float3 posL:POSITION0,float2 tex:TEXCOORD0)
{
	Output outVert = (Output)0;
	outVert.posH = mul(float4(posL,1.0f),gWVP);
	outVert.tex  = tex;
	return outVert;
}
float4 GrassPS(float2 tex:TEXCOORD0):COLOR0
{
	float4 texColor = tex2D(texSampler,tex);
	//float alpha = tex2D(texAlphaSampler,tex).a;
	//return float4(texColor.rgb,alpha);
	return texColor;
}

technique GrassTech
{
	pass P0
	{
		vertexShader = compile vs_2_0 GrassVS();
		pixelShader  = compile ps_2_0 GrassPS();
		CullMode = NONE;
		AlphaTestEnable = true ;
		AlphaFunc = GreaterEqual;
		AlphaRef = 100;
	}
}



